/*
 * @Description  :
 * @Author       : BuGua
 * @Date         : 2021-08-02 15:03:17
 * @LastEditors  : BuGua
 * @LastEditTime : 2021-08-11 11:41:14
 */
import styles from '../index.less'
import FliterQuery from './components/filterQuery'
import React, { FC, useEffect, useState, useRef } from 'react';
import { Space, message, Button, Popconfirm, Image, Table } from 'antd';
import type { ColumnsType } from 'antd/es/table';
import { connect } from 'umi';
import { ConnectState, LoginLayoutProps } from '@/models/connect';
import TableComponent from '@/components/tableComponent';
import monent from 'moment'

const menuPage = () => {
	interface DataType {
		key: string;
		name: string;
		age: number;
		address: string;
		tags: string[];
	}

	const columns: ColumnsType<DataType> = [
		{
			title: "图标",
			dataIndex: 'icon',
			key: 'icon',
			render: (text) =>
				<Image
					width={50}
					height={50}
					src={text}
				/>
		},
		{
			title: '地址名',
			dataIndex: 'title',
			key: 'title',
			// render: (text) => <a>{text}</a>,
		},
		{
			title: '地址url',
			dataIndex: 'path',
			key: 'path',
			// render: (text) => <a>{text}</a>,
		},
		{
			title: '创建时间',
			dataIndex: 'creatTime',
			key: 'creatTime',
			render: (text) => <a>{text && monent(text).format('YYYY-MM-DD HH:mm:ss')}</a>,
		},
		{
			title: '修改时间',
			dataIndex: 'updateTime',
			key: 'updateTime',
			render: (text) => <a>{text && monent(text).format('YYYY-MM-DD HH:mm:ss')}</a>,
		},
		{
			title: '操作',
			key: 'action',
			render: (a, b) => (
				<Space size="middle">
					<a onClick={() => { update(a) }}>修改 </a>
					<Popconfirm
						title={`你确定删除${a.username}嘛？`}
						onConfirm={() => { confirm(a) }}
						okText="确定"
						cancelText="取消"
					>
						<a>删除</a>
					</Popconfirm>
				</Space>
			),
		},
	];
	const update = (e: any) => {

	}
	return (
		<div className={styles.contnet}>
			{/* <FliterQuery /> */}

			<Table
				// loading={loading}
				columns={columns}
			// dataSource={tableData}
			// pagination={{ total: page.pageAll }}
			// onChange={pageChage}
			/>

		</div>
	);
};
export default menuPage;
